#! /bin/bash

# Creates log files in HDFS.
# All files in sample-data/raw-logs are processed and
#  stored with the proper delimiters for use with streaming.
# Modified (Vince) to fetch JOnas logs

hadoop fs -rmr logs
hadoop fs -mkdir logs
# for i in ../sample-data/raw-logs/*
for i in /home/vince/boulot/fac/2011-2012/ecom/3svn-ecom/ecom-coloc/wiki/Analyse_log/logs_JONAS_ECOM/*txt
do
  ruby import.rb <$i >/tmp/import
  f=`basename $i`
  hadoop fs -put /tmp/import logs/$f
done
